<template>
  <div class="app">
    <hello-word ref="xxx"></hello-word>

    <div ref="yyy">我是一个普通小div</div>

    <button @click="onClick">点我获取 hello-word 组件的 name 数据</button>
  </div>
</template>

<script>
import HelloWord from "./components/HelloWord.vue";

export default {
  name: "App",

  components: {
    HelloWord,
  },

  data() {
    return {
      curTab: "Posts",
    };
  },

  methods: {
    onClick() {
      console.log(this);
      // console.log(this.$refs.xxx.changeName("里斯"));

      this.$refs["yyy"].innerHTML = "大div";
    },
  },
};
</script>

<style>
.app {
  height: 1000px;
}
.active {
  color: red;
}
</style>
